package com.dangdang.action.main;

import com.dangdang.action.BaseAction;
import com.dangdang.domain.Category;
import com.dangdang.service.CatalogService;
import com.dangdang.service.ServiceFactory;

/**
 * 商品分类控制
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-1-25
 */
public class CategoryAction extends BaseAction {

	/** 分类列表 */
	private Category cat;

	private final CatalogService cs = ServiceFactory.getCatalogService();

	public Category getCat() {
		return cat;
	}

	public void setCat(Category cat) {
		this.cat = cat;
	}

	/**
	 * 获得所有的分类
	 * 
	 * @return
	 */
	public String execute() {
		// ture,意在是否显示该类的子类
		cat = cs.getCategoryById(CatalogService.BOOK_CAT, true);

		return "success";
	}
}
